const Controller = require("egg").Controller

class  RecommendController extends Controller{

  // 获取推荐的列表
  async getList(){
    let {ctx} = this,body = ctx.request.body
    try {
      ctx.validate({
        page:{type:"number",require:true,default:1},
        pageSize:{type:"number",require:true,max:30,min:5},
      })
      // 编写service层
      let recommendModel = await this.ctx.service.recommend.getList(body.page,body.pageSize)
      ctx.body = { msg:"success",code:0, data:recommendModel};
    } catch (error) {
      
    }
  }

}

module.exports = RecommendController